#include <iostream>
#include <string>
using namespace std;
string a, b;
void dp (string x, string y) {
	if (y.size() <= 0) {
		return;
	}
	int tmp = x.find(y[0]);
	dp (x.substr(0, tmp), y.substr(1, tmp));
	dp (x.substr(tmp + 1), y.substr(tmp + 1));
	cout << y[0];
	return;
}
int main () {
	while (cin >> b >> a) {
		dp (a, b);
		cout << endl;
	}
	return 0;
}